Tier-2: install-to-disk + boot-from-disk validation (server edition)#190
Merged
Conversation
New Tier-2 boot validation: prove the actual clean-disk installer works end to end, not just that an edition config boots (edition-*-boot already cover that). tests/install/server-install.nix — two-phase nixosTest (the nixpkgs installer pattern): an installation-environment VM runs the REAL scripts/install-image.sh against a blank /dev/vda, then the same disk is rebooted as a useBootLoader 'target' and asserted to reach multi-user.target on its own systemd-boot ESP (server edition; smallest closure). Installs a PREBUILT system toplevel offline (closure seeded read-only via extraDependencies) so the test does no network build — lighter + more deterministic than rebuilding in-VM. Asserts: GPT layout + EFI/nixos labels, systemd-bootx64.efi on the ESP, hostname/user/sshd, headless. scripts/install-image.sh — add the modes the test (and unattended installs) need: --assume-yes / SOURCEOS_ASSUME_YES skip the typed confirmation + final reboot --system <toplevel> / SOURCEOS_SYSTEM install a prebuilt system (no flake build) Refactored arg parsing into a flag loop; interactive behavior unchanged when neither is set. shellcheck-clean. flake.nix — checks.x86_64-linux.edition-server-install (skip stub elsewhere). image-tests.yml — opt-in run_install job (heavy: full install + 2 boots), so it never gates ordinary PRs. Promote to required once a CI dispatch confirms green. Validated locally: arg parser unit-tested, installer shellcheck-clean, the full nixosTest evaluates to a build derivation (KVM run happens in CI via dispatch).
First KVM run failed: the installer VM couldn't mount /sysroot because its root disk /dev/vdb (an emptyDiskImage) was never formatted. Mirror the nixpkgs installer-test approach — autoFormat under systemd initrd, mke2fs in postDeviceCommands under the classic initrd. Bumped vdb to 2 GiB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proves the real clean-disk installer works end to end — not just that an edition config boots (the existing
edition-*-boottests already cover that). This closes the Tier-2 boot-validation gap.What
tests/install/server-install.nix— two-phase nixosTest (the upstream nixpkgs installer-test pattern):scripts/install-image.shagainst a blank/dev/vda;useBootLoadertargetand asserted to reachmulti-user.targeton its own systemd-boot ESP.extraDependencies) — no in-VM network build, so it's lighter and more deterministic than upstream's rebuild-in-VM approach. Server edition = smallest closure.EFI/nixoslabels,systemd-bootx64.efion the ESP, hostname/sourceosuser/sshdactive, no display-manager (headless).scripts/install-image.sh— adds the modes the test (and unattended/automated installs) need, with interactive behavior unchanged when unset:--assume-yes/SOURCEOS_ASSUME_YES— skip the typed confirmation + final reboot prompt--system <toplevel>/SOURCEOS_SYSTEM— install a prebuilt system instead of composing+building a flakeflake.nix—checks.x86_64-linux.edition-server-install(skip stub on other systems).image-tests.yml— opt-inrun_installjob (heavy: full install + 2 boots) so it never gates ordinary PRs.Validation
install-image.shshellcheck-clean (0.11.0).nix eval …edition-server-install.drvPath).workflow_dispatch→run_install: true. Once it's confirmed green I'll promote it to a required check.Next Tier-2 item (separate PR): event-driven build status (replace GCS polling with the
EventEnvelopestream).